<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
    tr_X
</style>
<body class="gray-bg">
<style>
    .fixed-table-body{
        height: calc(73vh);
    }

    .fixed-table-footer{
        border-top: 0;
    }
</style>
<div class="">
    <div class="container-div">
        <div  id="flexSearchBox"  class="collapse out col-sm-12 search-box">
            <form id="user-form">
                <div class="select-list">
                    <ul>
                        <li class="time">
                            <label>Order Date:</label>
                            <input type="text" id="startTime" class="time-input reset"  placeholder="start date" name="beginOrderDate"/>
                            <span>to</span>
                            <input type="text" id="endTime" class="time-input reset"  placeholder="end date" name="endOrderDate"/>
                        </li>
                        <li>
                            Order ID：<input class="reset" type="text" name="orderID"/>
                        </li>
                        <li>
                            SKU：<input class="reset" type="text" name="unitSKUs"/>
                        </li>
                        <li class="time">
                            <label>Update Date:</label>
                            <input type="text" id="startTime1" class="time-input reset"  placeholder="start date" name="beginConfirmedDate"/>
                            <span>to</span>
                            <input type="text" id="endTime1" class="time-input reset"  placeholder="end date" name="endConfirmedDate"/>
                        </li>
                        <li>
                            AWB：<input class="reset" type="text" name="aWB"/>
                        </li>
                        <li shiro:hasPermission="module:returnReceived:companySearch">
                            company：<select class="reset_select" id="selCompanyId" name="companyID" >
                            <option th:each="dep : ${depList}" th:text="${dep.deptName}"
                                    th:value="${dep.deptId}"></option>
                        </select>
                        </li>
                        <li>
                            <a class="btn btn-success btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;search</a>
                            <a class="btn btn-primary btn-rounded btn-sm reset-booton"><i class="glyphicon glyphicon-repeat"></i>&nbsp;reset</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group hidden-xs" id="toolbar" role="group">
            <a class="btn btn-outline btn-info btn-rounded flex-botton" data-toggle="collapse" data-target="#flexSearchBox">
                <i class="glyphicon glyphicon-chevron-down">unfoldSearch
                </i>
            </a>
        </div>

        <div class="col-sm-12 select-info table-responsive">
            <table id="bootstrap-table" class="table text-nowrap" data-height="770" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var prefix = ctx + "module/returnReceived";
    var orderStateDict = [[${@dict.getType('erp_order_status')}]];//订单状态value转label
    var companyDict = [[${@dict.getType('erp_company')}]];//公司id转name

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            modalName: "订单详情",
            showFooter:true,
            /*queryParams:{
                orderStatus:"10703"
            },*/
            columns: [{
                checkbox: true
            },
                {
                    field : 'id',
                    title : 'ID',
                    visible: false
                },
                {
                    title: 'serialNumber',
                    
                    formatter: function (value, row, index) {
                        var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;     //通过table的#id 得到每页多少条
                        var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber; //通过table的#id 得到当前第几页
                        return pageSize * (pageNumber - 1) + index + 1;    // 返回每条的序号： 每页条数 *（当前页 - 1 ）+ 序号
                    },
                    footerFormatter: function (value) {
                        return 'total';
                    }
                },
                {
                    field : 'orderDate',
                    title : 'Order Date',
                    sortable: true,
                },
                {
                    field:'orderID',//订单id
                    title:'<span class="globalSearch_column">Order Id</span>',
                },
                {
                    field : 'orderStatus',//订单状态
                    title : 'Order Status',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(orderStateDict, value);
                    }
                },
                {
                    field : 'lastStatus',//订单上个状态
                    title : 'Last Status',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(orderStateDict, value);
                    }
                },
                {
                    field : 'ofItems',//商品数量
                    title : '# ofItems',
                    sortable: true,
                    footerFormatter: function (value) {
                        return calculateLineTotalAsServer(value,$.table.sumRows.ofItems);
                    }
                },
                {
                    field : 'totalHandlingTime',//处理时长
                    title : 'Total Handing Time',
                    sortable: true,
                },
                {
                    field : 'awb',//航空货运单
                    title : 'AWB'
                },
                {
                    field : 'courier',//快递
                    title : 'Courier'
                },
                {
                    field : 'itemCollectionType',//商品类型
                    title : 'Item Collection Type',
                    sortable: true,
                },
                {
                    field : 'totalShippingFees',//总运送费
                    title : 'Total Shipping Fees',
                    sortable: true,
                    footerFormatter: function (value) {
                        return calculateLineTotalAsServer(value,$.table.sumRows.totalShippingFees);
                    }
                },
                {
                    field : 'paidBySeller',//卖家付款
                    title : 'Paid By Seller',
                    sortable: true,
                    footerFormatter: function (value) {
                        return calculateLineTotalAsServer(value,$.table.sumRows.paidBySeller);
                    }
                },
                {
                    field : 'paymentMethod',//支付方式
                    title : 'Payment Method',
                    sortable: true,
                },
                {
                    field : 'codfee',//货到付款费用
                    title : 'Cod Fee',
                    sortable: true,
                    footerFormatter: function (value) {
                        return calculateLineTotalAsServer(value,$.table.sumRows.codfee);
                    }
                },
                {
                    field : 'isPaid',//是否支付
                    title : 'Is Paid',
                    sortable: true,
                },
                {
                    field : 'paymentReleaseDate',//付款日期
                    title : 'Payment Release Date',
                    sortable: true,
                },
                {
                    field : 'confirmedDate',//确认日期
                    title : 'Confirmed Date',
                    sortable: true,
                },
                {
                    field : 'shippedDate',//发货日期
                    title : 'Shipped Date',
                    sortable: true,
                },
                {
                    field : 'deliveryDate',//交货日期
                    title : 'Delivery Date',
                    sortable: true,
                },
                {
                    field : 'orderAge',//订单耗费时长
                    title : 'Order Age',
                    sortable: true,
                },
                {
                    field : 'shippedAge',//发货耗费时长
                    title : 'Shipped Age',
                    sortable: true,
                },
                {
                    field : 'deliveryAge',//交货耗费时长
                    title : 'Delivery Age',
                    sortable: true,
                },
                {
                    field : 'grandTotal',//总计
                    title : 'Grand Total',
                    sortable: true,
                    footerFormatter: function (value) {
                        return calculateLineTotalAsServer(value,$.table.sumRows.grandTotal);
                    }
                },
                {
                    field : 'unitSKUs',
                    title:'<span class="globalSearch_column">unitSKUs</span>',
                },
                {
                    field:'updateDate',//修改时间（缺省上传时间）
                    title:'<span class="globalSearch_column">lastOperationTime</span>',
                    sortable: true,
                },
                {
                    field : 'companyName',
                    title : 'company',

                },
            ],
            onLoadSuccess: function (item, $element) {
                $('.fixed-table-footer').addClass("totalRowBackground-color");//合计行添加颜色
            },
        };
        $.table.init(options);
    });
</script>
<script th:src="@{/ruoyi/js/common.js}"></script>
<script th:src="@{/ajax/libs/jquery-migrate/jQuery.print.min.js}"></script>
</body>
</html>